package com.learn.entity;

import javax.persistence.*;

@Entity
@Table(name = "acl", schema = "base", catalog = "")
public class AclEntity {
    private int id;
    private String name;
    private String module;
    private String controller;
    private String action;
    private Byte status;
    private Byte isMenu;
    private String menuUrl;
    private String menuCss;
    private int sort;
    private int pid;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 45)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "module", nullable = true, length = 20)
    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    @Basic
    @Column(name = "controller", nullable = true, length = 255)
    public String getController() {
        return controller;
    }

    public void setController(String controller) {
        this.controller = controller;
    }

    @Basic
    @Column(name = "action", nullable = true, length = 255)
    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    @Basic
    @Column(name = "is_menu", nullable = true)
    public Byte getIsMenu() {
        return isMenu;
    }

    public void setIsMenu(Byte isMenu) {
        this.isMenu = isMenu;
    }

    @Basic
    @Column(name = "menu_url", nullable = true, length = 128)
    public String getMenuUrl() {
        return menuUrl;
    }

    public void setMenuUrl(String menuUrl) {
        this.menuUrl = menuUrl;
    }

    @Basic
    @Column(name = "menu_css", nullable = true, length = 45)
    public String getMenuCss() {
        return menuCss;
    }

    public void setMenuCss(String menuCss) {
        this.menuCss = menuCss;
    }

    @Basic
    @Column(name = "sort", nullable = false)
    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    @Basic
    @Column(name = "pid", nullable = false)
    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AclEntity aclEntity = (AclEntity) o;

        if (id != aclEntity.id) return false;
        if (sort != aclEntity.sort) return false;
        if (pid != aclEntity.pid) return false;
        if (name != null ? !name.equals(aclEntity.name) : aclEntity.name != null) return false;
        if (module != null ? !module.equals(aclEntity.module) : aclEntity.module != null) return false;
        if (controller != null ? !controller.equals(aclEntity.controller) : aclEntity.controller != null) return false;
        if (action != null ? !action.equals(aclEntity.action) : aclEntity.action != null) return false;
        if (status != null ? !status.equals(aclEntity.status) : aclEntity.status != null) return false;
        if (isMenu != null ? !isMenu.equals(aclEntity.isMenu) : aclEntity.isMenu != null) return false;
        if (menuUrl != null ? !menuUrl.equals(aclEntity.menuUrl) : aclEntity.menuUrl != null) return false;
        if (menuCss != null ? !menuCss.equals(aclEntity.menuCss) : aclEntity.menuCss != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (module != null ? module.hashCode() : 0);
        result = 31 * result + (controller != null ? controller.hashCode() : 0);
        result = 31 * result + (action != null ? action.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (isMenu != null ? isMenu.hashCode() : 0);
        result = 31 * result + (menuUrl != null ? menuUrl.hashCode() : 0);
        result = 31 * result + (menuCss != null ? menuCss.hashCode() : 0);
        result = 31 * result + sort;
        result = 31 * result + pid;
        return result;
    }
}
